package spec.lijunyao.unit4.example.e_4_15;

public class StringBufferTest {
    public static void main(String[] args) {
        String s = "Hello Java!";
        StringBuffer sb = new StringBuffer();
        /**
         * 链式编程
         * StringBuffer有个类方法叫append
         * 他的返回值也是StringBuffer
         * StringBuffer对象可以去访问类方法append
         */
        (sb.append(s)).append("你好,").append("Java!");
        System.out.println(sb);
        sb.deleteCharAt(5);
        System.out.println(sb);
        System.out.println(sb.reverse());
    }
}